import drds.server.route.parser.core.ShardInfoVisitor;
import drds.server.sqlparser.SQLUtils;
import drds.server.sqlparser.parser.StatementParser;
import drds.server.sqlparser.sqlobject.statement.Statement;
import drds.server.sqlparser.visitor.Visitor;

public class AAAA {
	public static void main(String[] args) {
		String sql = "select a.id,b.name from user as a left join hiv as b on a.id=b.id where 1=1";
		StatementParser statementParser = new StatementParser(sql);
		Statement statement = statementParser.parseStatement();
		Visitor visitor = new ShardInfoVisitor();
		statement.accept(visitor);
		// 获取表名称
		String result = SQLUtils.format(sql);
		System.out.println(result);
	}
}
